package orders

import "yundian/internel/pkg/dingo"

type OrdersAttr func(model *OrderModel)

type OrdersAttrs []OrdersAttr

func (attrFunc OrdersAttrs) Apply(model *OrderModel) {
	for _, f := range attrFunc {
		f(model)
	}
}

func WithId(id int) OrdersAttr {
	return func(model *OrderModel) { model.Id = id }
}

func WithAppid(appid string) OrdersAttr {
	return func(model *OrderModel) { model.Appid = appid }
}

func WithMchid(mchid string) OrdersAttr {
	return func(model *OrderModel) { model.Mchid = mchid }
}

func WithProductId(productId string) OrdersAttr {
	return func(model *OrderModel) { model.ProductId = productId }
}

func WithOpenid(openid string) OrdersAttr {
	return func(model *OrderModel) { model.Openid = openid }
}

func WithTradeNo(tradeNo string) OrdersAttr {
	return func(model *OrderModel) { model.TradeNo = tradeNo }
}

func WithOutTradeNo(outTradeNo string) OrdersAttr {
	return func(model *OrderModel) { model.OutTradeNo = outTradeNo }
}

func WithTradeType(tradeType string) OrdersAttr {
	return func(model *OrderModel) { model.TradeType = tradeType }
}

func WithTradeState(tradeState string) OrdersAttr {
	return func(model *OrderModel) { model.TradeState = tradeState }
}

func WithTradeStateDesc(tradeStateDesc string) OrdersAttr {
	return func(model *OrderModel) { model.TradeStateDesc = tradeStateDesc }
}

func WithTradeStateDoing(tradeStateDoing string) OrdersAttr {
	return func(model *OrderModel) { model.TradeStateDoing = tradeStateDoing }
}

func WithOrderFrom(orderFrom string) OrdersAttr {
	return func(model *OrderModel) { model.OrderFrom = orderFrom }
}

func WithPayFrom(payFrom int8) OrdersAttr {
	return func(model *OrderModel) { model.PayFrom = payFrom }
}

func WithPayType(payType int8) OrdersAttr {
	return func(model *OrderModel) { model.PayType = payType }
}

func WithMoney(money int64) OrdersAttr {
	return func(model *OrderModel) { model.Money = money }
}

func WithMoneyStr(moneyStr string) OrdersAttr {
	return func(model *OrderModel) { model.MoneyStr = moneyStr }
}

func WithPayMoney(payMoney int64) OrdersAttr {
	return func(model *OrderModel) { model.PayMoney = payMoney }
}

func WithPayMoneyStr(payMoneyStr string) OrdersAttr {
	return func(model *OrderModel) { model.PayMoneyStr = payMoneyStr }
}

func WithRefundMoney(refundMoney int64) OrdersAttr {
	return func(model *OrderModel) { model.RefundMoney = refundMoney }
}

func WithSettlementWay(settlementWay int8) OrdersAttr {
	return func(model *OrderModel) { model.SettlementWay = settlementWay }
}

func WithSettlementState(settlementState int8) OrdersAttr {
	return func(model *OrderModel) { model.SettlementState = settlementState }
}

func WithCouponType(couponType int8) OrdersAttr {
	return func(model *OrderModel) { model.CouponType = couponType }
}
func WithCouponMoney(couponMoney int64) OrdersAttr {
	return func(model *OrderModel) { model.CouponMoney = couponMoney }
}

func WithSettlementMoney(settlementMoney int64) OrdersAttr {
	return func(model *OrderModel) { model.SettlementMoney = settlementMoney }
}

func WithSettlementMoneyStr(settlementMoneyStr string) OrdersAttr {
	return func(model *OrderModel) { model.SettlementMoneyStr = settlementMoneyStr }
}

func WithState(state int8) OrdersAttr {
	return func(model *OrderModel) { model.State = state }
}

func WithDeviceSn(deviceSn string) OrdersAttr {
	return func(model *OrderModel) { model.DeviceSn = deviceSn }
}

func WithSharedMode(sharedMode string) OrdersAttr {
	return func(model *OrderModel) { model.SharedMode = sharedMode }
}

func WithFeeMode(feeMode int8) OrdersAttr {
	return func(model *OrderModel) { model.FeeMode = feeMode }
}

func WithTitle(title string) OrdersAttr {
	return func(model *OrderModel) { model.Title = title }
}

func WithIsDraw(isDraw int8) OrdersAttr {
	return func(model *OrderModel) { model.IsDraw = isDraw }
}

func WithIsTianHai(isTianHai int8) OrdersAttr {
	return func(model *OrderModel) { model.IsTianHai = isTianHai }
}

func WithMemberId(memberId string) OrdersAttr {
	return func(model *OrderModel) { model.MemberId = memberId }
}

func WithMemberName(memberName string) OrdersAttr {
	return func(model *OrderModel) { model.MemberName = memberName }
}

func WithMemberPhone(memberPhone string) OrdersAttr {
	return func(model *OrderModel) { model.MemberPhone = memberPhone }
}

func WithPlaceId(placeId int) OrdersAttr {
	return func(model *OrderModel) { model.PlaceId = placeId }
}

func WithPlaceName(placeName string) OrdersAttr {
	return func(model *OrderModel) { model.PlaceName = placeName }
}

func WithUserId(userId int) OrdersAttr {
	return func(model *OrderModel) { model.UserId = userId }
}

func WithUserName(userName string) OrdersAttr {
	return func(model *OrderModel) { model.UserName = userName }
}

func WithParentId(parentId int) OrdersAttr {
	return func(model *OrderModel) { model.ParentId = parentId }
}

func WithAgentUserId(agentUserId int) OrdersAttr {
	return func(model *OrderModel) { model.AgentUserId = agentUserId }
}

func WithCreateAt(createAt dingo.Time) OrdersAttr {
	return func(model *OrderModel) { model.CreateAt = createAt }
}

func WithBeginAt(beginAt dingo.Time) OrdersAttr {
	return func(model *OrderModel) { model.BeginAt = beginAt }
}

func WithUpdateAt(updateAt dingo.Time) OrdersAttr {
	return func(model *OrderModel) { model.UpdateAt = updateAt }
}

func WithEndAt(endAt dingo.Time) OrdersAttr {
	return func(model *OrderModel) { model.EndAt = endAt }
}

func WithPayAt(payAt dingo.Time) OrdersAttr {
	return func(model *OrderModel) { model.PayAt = payAt }
}

func WithRefundAt(refundAt dingo.Time) OrdersAttr {
	return func(model *OrderModel) { model.RefundAt = refundAt }
}

func WithDeleteAt(deleteAt dingo.Time) OrdersAttr {
	return func(model *OrderModel) { model.DeleteAt = deleteAt }
}

func WithKaUserId(kaUserId int) OrdersAttr {
	return func(model *OrderModel) { model.KAUserId = kaUserId }
}

func WithProdType(prodType uint8) OrdersAttr {
	return func(model *OrderModel) { model.ProdType = prodType }
}
